import request from '@/utils/request'

// 获取员工列表
export const reqGetEmpList = (page, size) => request.get('/sys/user', { params: { page, size }})

// 根据id删除
export const reqDelEmp = id => request.delete(`/sys/user/${id}`)

// 添加员工
export const reqAddEmp = data => request.post('/sys/user', data)

// 批量导入员工
export const reqImpEmp = data => request.post('/sys/user/batch', data)

// 保存员工信息
export const reqSaveUser = data => request.put(`/sys/user/${data.id}`, data)

// 读取用户详情的基础信息 (个人详情-下面的接口)
export const reqGetPersonalDetail = (id) => request.get(`/employees/${id}/personalInfo`)

// 更新用户详情的基础信息 (个人详情-下面的接口)
export const reqUpdatePersonal = data => request.put(`/employees/${data.userId}/personalInfo`, data)

// 获取用户的岗位信息  (岗位信息)
export const reqGetJobDetail = id => request.get(`/employees/${id}/jobs`)

// 保存岗位信息  (岗位信息)
export const reqUpdateJob = data => request.put(`/employees/${data.userId}/jobs`, data)

// 给员工分配角色
export const reqAssignRoles = data => request.put('/sys/user/assignRoles', data)
